package memento.general;

/**
 * @Author：LJ
 * @Description：
 * @Date: 2017/12/1
 * @Modified By:
 */
public class Client {

    public static void main(String[] args) throws CloneNotSupportedException {
        //定义一个发起人
        Originator originator = new Originator();
        //定义备忘录管理员
        Caretaker caretaker = new Caretaker();
        //创建一个备忘录
        caretaker.setMemento(originator.createMemento());
        //回复一个备忘录
        originator.restoreMemento(caretaker.getMemento());
    }
}
